//头文件声明
#include "display.h"

unsigned char code leddata[] = { //数码管的段码表
 
                0x3F,  //"0"
                0x06,  //"1"
                0x5B,  //"2"
                0x4F,  //"3"
                0x66,  //"4"
                0x6D,  //"5"
                0x7D,  //"6"
                0x07,  //"7"
                0x7F,  //"8"
                0x6F,  //"9"
                0x77,  //"A"
                0x7C,  //"B"
                0x39,  //"C"
                0x5E,  //"D"
                0x79,  //"E"
                0x71,  //"F"
                0x76,  //"H"
                0x38,  //"L"
                0x37,  //"n"
                0x3E,  //"u"
                0x73,  //"P"
                0x5C,  //"o"
                0x40,  //"-"
                0x00,  //熄灭
 
                         };
unsigned char LEDBuff[] = { 22,22,22,22,22,22,22,22 };//数据缓冲区
unsigned char code PLACE_CODE[] = { 0xFF,0xFB,0xF7,0xF3,0xEF,0xEB,0xE7,0xE3 };//位选信号

/***********************************
函数名：Display
功  能：数码管动态显示
参  数：无
返回值：无
*************************************/
void Display()
{
	 unsigned char i;
	//1、送段码
	GPIO_DIG = leddata[LEDBuff[i]];
	//2、送位选
	GPIO_PLACE = PLACE_CODE[i];
	//3、延时 1ms < 10ms
	DelayXms(1);
	//4、消隐
	GPIO_DIG = 0x00;
	i++;
	if (N == i)
		i = 0;
	
}